package com.sample.thread.join;
/**
* @comments
* @author  zg
* @date 2021年3月12日
*/
public class JoinTester {

	public static void main(String[] args) throws Exception {
		JoinThread t1 = new JoinThread("线程1", 5);
		JoinThread t2 = new JoinThread("线程2", 3);
		JoinThread t3 = new JoinThread("线程3", 2);
		JoinThread t4 = new JoinThread("线程4", 1);
		JoinThread t5 = new JoinThread("线程5", 7);
		
		t1.start();
		t1.join();//等待异步任务完成并获取结果
		
		t2.start();
		t2.join();
		
		t3.start();
		t3.join();
		
		t4.start();
		t4.join();
		
		t5.start();
		
	}

}
